home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga News 95
/
Amiga News 95.iso
/
amig(ad)os
/
ringard'production
/
m2i_v5.51
/
arexx
/
autoadd.m2i
< prev
next >
Wrap
Text File
|
1977-12-31
|
1KB
|
66 lines
/* Ajoute des Outils automatiquement
d'un répertoire en regardant les .info */
/* TP 1996 */
OPTIONS RESULTS
address "M2IPort.Rexx"
DRAWER="'Nouveau'"
REQUEST GADGETS "'Choix du Répertoire|Abandon'" "M2I va créer des Icônes en fonction d'un Répertoire"
IF RC=0 THEN EXIT
REQDIR ""
IF RC~=0 THEN EXIT
MONDIR=RESULT
IF LASTPOS('/',MONDIR)~=0 THEN MONDIR=MONDIR"/"
LOCKUSER
/* Chercher fichiers */
address command
i=0
LISTDIR=MONDIR"#?.info"
LISTDIR='"'LISTDIR'"'
'list' LISTDIR 'quick files nohead to t:ls.tmp'
IF OPEN(1List, 't:ls.tmp', 'r') THEN
DO i = 1 while ~eof(1List)
File.i = readln(1List)
END
call CLOSE 1List
'delete >nil: t:ls.tmp'
/* ajouter */
address "M2IPort.Rexx"
IF i<3 THEN
DO
ERROR "La commande List n'a rien trouvé"
UNLOCKUSER
EXIT
END
COUNT ":"DRAWER
IF RESULT=0 THEN ADDDRW DRAWER ":"
SET WLIST "1" ":"DRAWER".d"
num=1
i=i-1
DO while num<i
/* Supprimer .info et ajouter le dir*/
NEW=MONDIR""LEFT(file.num,length(file.num)-5)
num=num+1
/* Ajouter */
ADDICON "'"NEW"'" ":"DRAWER".d"
END
opendrw ":"DRAWER".d"
redraw ":"DRAWER".d"
redraw ":"
UNLOCKUSER